home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 2010 April / PCWorld0410.iso / hity wydania / Ubuntu 9.10 PL / karmelkowy-koliberek-desktop-9.10-i386-PL.iso / casper / filesystem.squashfs / usr / share / recovery-mode / recovery-menu < prev   
Text File  |  2009-10-23  |  789b  |  43 lines

  1. #!/bin/bash
  2.  
  3. # include gettext stuff
  4. . /usr/share/recovery-mode/l10n.sh
  5.  
  6. # main
  7. menu_text=$(eval_gettext "Recovery Menu")
  8.  
  9. while true; do
  10.   unset items
  11.  
  12.   items[c++]="resume"
  13.   items[c++]=$(eval_gettext "   Resume normal boot")
  14.  
  15.   for i in /usr/share/recovery-mode/options/*; do
  16.     if [ -x "$i" ]; then
  17.       name="`"$i" test`"
  18.       if [ $? -eq 0 ]; then
  19.         items[c++]="`basename "$i"`"
  20.         items[c++]="   $name"
  21.       fi
  22.     fi
  23.   done
  24.  
  25.   choice="$(/usr/bin/whiptail --menu "$menu_text" 15 70 6 \
  26.                              "${items[@]}" \
  27.                              3>&1 1>&2 2>&3 3>&-)"
  28.  
  29.   if [ $? -ne 0 ]; then
  30.     exit
  31.   fi
  32.  
  33.   if [ "$choice" = "resume" ]; then
  34.     exit
  35.   fi
  36.  
  37.   "/usr/share/recovery-mode/options/$choice"
  38.  
  39.   if [ "$?" -eq 42 ]; then
  40.     exit 0
  41.   fi
  42. done
  43.